import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/manage',
    name: '',
    component: () => import(/* webpackChunkName: "about" */ '../views/manage.vue'),
    children: [{
      path: '',
      component: Home,
      meta: [],
    }, {
      path: '/userList',
      name: 'userList',
      component: () => import('../views/userList.vue'),
      meta: ['用户管理', '用户列表'],
    }, {
      path: '/garageManage',
      name: 'garageManage',
      component: () => import('../views/garageManage.vue'),
      meta: ['车库车道管理'],
    }, {
      path: '/carList',
      name: 'carList',
      component: () => import('../views/carList.vue'),
      meta: ['车辆管理', '车辆列表'],
    }, {
      path: '/throughRecords',
      name: 'throughRecords',
      component: () => import('../views/throughRecords.vue'),
      meta: ['车辆管理', '出入库记录'],
    }, {
      path: '/remoteManage',
      name: 'remoteManage',
      component: () => import('../views/remoteManage.vue'),
      meta: ['遥控器管理'],
    }, {
      path: '/charge',
      name: 'charge',
      component: () => import('../views/charge.vue'),
      meta: ['收费管理', '收费'],
    }, {
      path: '/chargeRecords',
      name: 'chargeRecords',
      component: () => import('../views/chargeRecords.vue'),
      meta: ['收费管理', '收费列表'],
    }, {
      path: '/setting',
      name: 'setting',
      component: () => import('../views/setting.vue'),
      meta: ['系统设置'],
    }, {
      path: '/statistical',
      name: 'statistical',
      component: () => import('../views/statistical.vue'),
      meta: ['统计报表'],
    }]
  }
]

const router = new VueRouter({
  routes
})

export default router
